import json

before = []
after = []

with open("before.json", "r") as f:
    before = json.load(f)

for item in before:
    after.append(
        {
            "instruction": item["input"],
            "input": "",
            "output": item["output"],
        }
    )

with open("after.json", "w") as f:
    dt = json.dumps(after, indent=4, separators=(',', ': '), ensure_ascii=False)
    f.write(dt)